InsCode.constructor   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 39
Code Lines 25

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 25
dl 0
loc 39
rs 9.28
c 0
b 0
f 0
cc 1
nc 1
nop 0

4 Functions

Rating   Name   Duplication   Size   Complexity  
A InsCode.display 0 34 1
A InsCode.display 0 6 1
A InsCode.display 0 7 1
A InsCode.display 0 27 1
1
var InsCode = function()
2
{
3
	return {
4
		display: function(markItUp) {
5
			console.log(markItUp);
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
6
			var textareaID = markItUp.textarea.id;
7
			var textarea = $('#' + textareaID);
8
			var output = '';
0 ignored issues
show
Unused Code introduced by
The variable output seems to be never used. Consider removing it.
Loading history...
9
			$('#ins-code-form').remove();
10
			$.get(markItUp.root + 'InsCode/InsCode.html', function (data) {
11
				$('body').append(data);
12
				var form = $('#ins-code-form');
13
14
				form.css({
15
					'top': textarea.position().top + 5,
16
					'left': textarea.closest('.markItUpContainer').find('li.ins-code-button').position().left - 322
17
				});
18
				form.find('#ins-code-code').val(markItUp.selection);
19
20
				form.find('a.cancel').click(function (e) {
21
					e.preventDefault();
22
					form.fadeOut(function () {
23
						form.remove();
24
					});
25
				});
26
27
				form.fadeIn();
28
29
				form.on('submit', function(e) {
30
					e.preventDefault();
31
					$.markItUp({target: '#' + textareaID, openWith: '<pre lang="' + $(this).find('#ins-code-language').val() + '">', closeWith: '</pre>', placeHolder:$(this).find('#ins-code-code').val()});
32
					form.fadeOut(function () {
33
						form.remove();
34
					});
35
				});
36
			});
37
		}
38
	}
39
}();
40